//
//  ViewController.m
//  控件的平移旋转缩放
//
//  Created by hyl on 16/6/5.
//  Copyright © 2016年 hyl. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (nonatomic,strong) UIView *tempView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tempView=[[UIView alloc]initWithFrame:CGRectMake(50, 50, 100, 100)];
    self.tempView.backgroundColor=[UIColor redColor];
    [self.view addSubview:self.tempView];
}

-(void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    //self.tempView.transform=CGAffineTransformMakeTranslation(50, 50);
    [UIView animateWithDuration:1.0 animations:^{
        //同时进行两种transform
        CGAffineTransform transform=CGAffineTransformMakeTranslation(50, 50);
        CGAffineTransform scaleTransform=CGAffineTransformScale(transform, 0.5, 0.5);
        self.tempView.transform=scaleTransform;
    
    }];
    self.tempView.transform=CGAffineTransformIdentity;
}
@end
